<!DOCTYPE html>
<html lang="zh-CN" xml:lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <title>设置新密码</title>
    <script type="text/javascript">
        var html = document.getElementsByTagName("html")[0];
        var proportion= html.clientWidth/750*100;
        if(proportion<=100){
            html.style.fontSize = proportion+"px";
        }else{
            html.style.fontSize = 100+"px";
        }
    </script>
    <link rel="stylesheet" type="text/css" href="__CSS__/LoginAndRegister/set_code.css">
</head>
<body>

<div class="header"><span class="goback"></span>设置新密码</div>
<form id="set_container" method="post" action="{:U('/Home/LoginAndRegister/Login/UpPassword',array('x'=>'secret','f'=>'json','t'=>'wap','mobile'=>$mobile))}" onsubmit="return checkpassword()">
    <section class="set_inner">
        <div class="code_one"><div class="code_one_wrapper"><input id="new_code" name = "password" type="password" placeholder="新密码：" autocomplete="off" ></div></div>
        <div class="long_line"></div>
        <div class="code_two"><div class="code_two_wrapper"><input id="code_again" name ="repassword" type="password" placeholder="确认新密码：" autocomplete="off" ></div></div>
    </section>
    <input type="submit" id="confirm_btn" value="确定" >
</form>
</body>
<script src="__JS__/jquery-2.0.0/jquery.min.js"></script>
<script>
    function checkpassword(){
        var password=$("#new_code").val();
        if(password ==''){
            alert('请填写密码');
            return false;
        }
        var ls=0;
        if(password.match(/([a-z])+/)){  ls++; }/*验证字母*/
        if(password.match(/([0-9])+/)){  ls++; }/*验证数字*/
        if(password.length <6 || password.length > 20){
            alert('请长度保持在6-20');
            return false;
        }
        if(ls !=2){
            alert("密码由数字和字母组成");
            return false;
        }
        var repassword =$("#code_again").val();
        if(password!==repassword){
            alert("两次密码不一致");
            return false;
        }
        return true;
    }
</script>
</html>